<!--
//===============================================================================
// Microsoft Architecture Strategy Team
// LitwareHR - S+S Sample Application
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================
-->

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:LitwareHR.PublicApp.WinUX"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    x:Class="LitwareHR.PublicApp.WinUX.OpenPositionView" VerticalAlignment="Top" VerticalContentAlignment="Top"  Background="{DynamicResource BorderBrush}"
	xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
	>

	<UserControl.Resources>
    <Storyboard x:Key="OnLoadedTransition">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rootCanvas" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
        <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
		<LinearGradientBrush x:Key="OutboxHeaderBrush" EndPoint="0.5,0.173" StartPoint="0.5,0.827">
			<GradientStop Color="#FF2373BE" Offset="0"/>
			<GradientStop Color="#FF6496C8" Offset="1"/>
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="BottomPanelBrush" EndPoint="0.5,0.119" StartPoint="0.5,1.081">
			<GradientStop Color="#FF0F152B" Offset="0"/>
			<GradientStop Color="#FF5A6496" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="HeaderTextBrush" Color="#FFDCDCE6"/>
		<SolidColorBrush x:Key="GridBodyBrush" Color="#7F28C8FF"/>

		<LinearGradientBrush x:Key="GridShadowBrush" EndPoint="0.5,1.057" StartPoint="0.5,-0.057">
			<GradientStop Color="#33FFFFFF" Offset="0"/>
			<GradientStop Color="#00000000" Offset="1"/>
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="PageBackgroundBrush" EndPoint="0.989,0.068" StartPoint="0.718,0.4">
			<GradientStop Color="#FF30265A" Offset="0"/>
			<GradientStop Color="#FF80BEE7" Offset="1"/>
			<GradientStop Color="#FF332B5F" Offset="0.038"/>
			<GradientStop Color="#FF7DB8E2" Offset="0.966"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="BorderBrush" Color="#FFC1C3DC"/>
		<!-- XLS Button Style -->
		<Style x:Key="btnXLS" BasedOn="{x:Null}" TargetType="{x:Type Button}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<Image Width="20" Height="20" Source="..\..\Images\xls.png" />
							<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsFocused" Value="True"/>
							<Trigger Property="IsDefaulted" Value="True"/>
							<Trigger Property="IsMouseOver" Value="True"/>
							<Trigger Property="IsPressed" Value="True"/>
							<Trigger Property="IsEnabled" Value="False"/>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="GlassyButtonStyle" BasedOn="{x:Null}" TargetType="{x:Type Button}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<ControlTemplate.Resources>
							<Storyboard x:Key="Timeline1">
								<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonBase" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
									<SplineColorKeyFrame KeyTime="00:00:00" Value="#FF008EB5"/>
									<SplineColorKeyFrame KeyTime="00:00:00.1280000" Value="#FF00C8FF"/>
								</ColorAnimationUsingKeyFrames>
							</Storyboard>
							<Storyboard x:Key="Timeline2">
								<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="ButtonBase">
									<SplineColorKeyFrame KeyTime="00:00:00" Value="#FF00C8FF"/>
									<SplineColorKeyFrame KeyTime="00:00:00.2520000" Value="#FF008EB5"/>
								</ColorAnimationUsingKeyFrames>
							</Storyboard>
						</ControlTemplate.Resources>
						<Grid>
							<Rectangle Stroke="{x:Null}" RadiusX="5" RadiusY="5" x:Name="Reflection" Margin="0,0,0,-20.646" VerticalAlignment="Bottom" Height="18">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="0.497,0.515" StartPoint="0.499,-0.119">
										<GradientStop Color="#2DFFFFFF" Offset="0"/>
										<GradientStop Color="#00FFFFFF" Offset="1"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<Rectangle Stroke="{x:Null}" RadiusX="5" RadiusY="5" Margin="0,1,0,-1" x:Name="ButtonBase">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
										<GradientStop Color="#FF00598C" Offset="0"/>
										<GradientStop Color="#FF008EB5" Offset="1"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<Rectangle Stroke="{x:Null}" RadiusX="5" RadiusY="5" Margin="0,0.999,0,-0.999" x:Name="GlassyTop">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="0.496,0.626" StartPoint="0.5,-0.008">
										<GradientStop Color="#4CFFFFFF" Offset="0"/>
										<GradientStop Color="#00FFFFFF" Offset="1"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" Margin="10,1,10,1" TextElement.Foreground="White" />
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsFocused" Value="True"/>
							<Trigger Property="IsDefaulted" Value="True"/>
							<Trigger Property="IsMouseOver" Value="True">
								<Trigger.EnterActions>
									<BeginStoryboard Storyboard="{StaticResource Timeline1}"/>
								</Trigger.EnterActions>
								<Trigger.ExitActions>
									<BeginStoryboard x:Name="Timeline2_BeginStoryboard" Storyboard="{StaticResource Timeline2}"/>
								</Trigger.ExitActions>
							</Trigger>
							<Trigger Property="IsPressed" Value="True"/>
							<Trigger Property="IsEnabled" Value="False"/>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ListViewItemStyleBase" TargetType="{x:Type ListViewItem}">
			<Setter Property="BorderThickness" Value="1,1,1,1" />
			<Setter Property="BorderBrush" Value="#FF1D0F48" />
			<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
			<Setter Property="VerticalContentAlignment" Value="Stretch"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListViewItem}">
						<Border BorderBrush="{DynamicResource GridBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5,5,5,5" Margin="-2,0,0,0"  Width="330">
							<StackPanel>
								<GridViewRowPresenter Height="15" Width="330" />
							</StackPanel>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<Style x:Key="LstVwItmStyle1" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource ListViewItemStyleBase}">
			<Setter Property="Background" Value="#FFEBEBEB" />
		</Style>

		<Style x:Key="LstVwItmStyle2" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource ListViewItemStyleBase}">
			<Setter Property="Background" Value="#FFC9D5E1" />
		</Style>
		<!-- TBUC -->
		<local:ListViewItemStyleSelector x:Key="ListViewItemStyleSelector" />


		<Style x:Key="headerStyle1" TargetType="{x:Type GridViewColumnHeader}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
						<Border  BorderThickness="2,2,0,2" CornerRadius="5,0,0,5" TextBlock.TextAlignment="Center" Width="{TemplateBinding  Width}" BorderBrush="#FF1D0F48" Background="#FFE2EFC3"  >
							<ContentPresenter Content="{TemplateBinding Content}" Height="15" ></ContentPresenter>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="headerStyle2" TargetType="{x:Type GridViewColumnHeader}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
						<Border  BorderThickness="0,2,0,2" CornerRadius="0,0,0,0" TextBlock.TextAlignment="Center" Width="{TemplateBinding  Width}" BorderBrush="#FF1D0F48" Background="#FFE2EFC3"  >
							<ContentPresenter Content="{TemplateBinding Content}" Height="15" ></ContentPresenter>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="headerStyle3" TargetType="{x:Type GridViewColumnHeader}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
						<Border  BorderThickness="0,2,2,2" CornerRadius="0,5,5,0" TextBlock.TextAlignment="Center" Width="{TemplateBinding  Width}" BorderBrush="#FF1D0F48" Background="#FFE2EFC3"  >
							<ContentPresenter Content="{TemplateBinding Content}" Height="15" ></ContentPresenter>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<LinearGradientBrush x:Key="LeftPanelGradientBrush" EndPoint="0.208,1.062" StartPoint="0.792,-0.062">
			<GradientStop Color="#FF0F152B" Offset="0"/>
			<GradientStop Color="#FF413A70" Offset="1"/>
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="DragNDropGradientBrush" EndPoint="0.012,0.986" StartPoint="0.988,0.014">
			<GradientStop Color="#FF195078" Offset="0"/>
			<GradientStop Color="#FF2F5D96" Offset="1"/>
		</LinearGradientBrush>
	</UserControl.Resources>
  <UserControl.Triggers>
    <EventTrigger RoutedEvent="FrameworkElement.Loaded">
      <BeginStoryboard Storyboard="{StaticResource OnLoadedTransition}"/>
    </EventTrigger>
  </UserControl.Triggers>
	<Canvas x:Name="rootCanvas">
		<Grid Background="{DynamicResource PageBackgroundBrush}" Margin="0,0,0,0" Width="844" Height="550">
			<Grid.ColumnDefinitions>
				<ColumnDefinition></ColumnDefinition>
				<ColumnDefinition></ColumnDefinition>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="0.873*"/>
				<RowDefinition Height="0.127*"/>
			</Grid.RowDefinitions>
			<!-- Start of Left Panel-->
			<Border BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource LeftPanelGradientBrush}"  BorderThickness ="1"  CornerRadius ="0,0,20,0" Grid.Column="0" Grid.Row="0" Margin="20,20,20,0" Width="350" Padding="0,0,0,0" HorizontalAlignment="Left">
				<DockPanel Name="dpLeftPanel" Margin="5" Width="Auto">
					<TextBlock DockPanel.Dock="Top" Width="Auto" Name="ErrorTxt"  Text="" Height="25"  FontWeight="Normal" Foreground="#FFE3EA20" HorizontalAlignment="Center" ></TextBlock>
					<Grid DockPanel.Dock="Top" Width="Auto" Name ="SearchGrid" Margin ="10" HorizontalAlignment="Stretch" VerticalAlignment="Top" >
					</Grid>
					<!-- Start of Drag and Drop Canvas -->
					<Border DockPanel.Dock="Bottom" Width="Auto" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource DragNDropGradientBrush}" BorderThickness ="1"  CornerRadius ="0,0,20,0" Height="100" Margin="10,12,10,10" Name="DragNDropCanvasBorder" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
						<!--AllowDrop="True" DragOver="DragNDropCanvasDragOver" -->
						<!--Drop="DragNDropCanvasDrop"-->
						<DockPanel Name="dpDragNDrop" Width="280" Height="75" Margin="10,10,10,0" HorizontalAlignment="Stretch">
							<TextBlock FontStyle="Italic" VerticalAlignment="Top" HorizontalAlignment="Right" DockPanel.Dock="Top" Foreground="{DynamicResource DragDropTextBrush}">Click on Icon to import from Excel</TextBlock>
							<TextBlock DockPanel.Dock="Left" Width="145" Name="tbClickHereToImportExcelFile" Text="Click here to import excel file" HorizontalAlignment="Right" Margin="90,40,0,0" FontStyle="Italic" Foreground="{DynamicResource DragDropTextBrush}"/>
							<Button Name="btnBrowse" Style="{DynamicResource btnXLS}" VerticalAlignment="Bottom" HorizontalAlignment="Right" DockPanel.Dock="Right" Click="OpenFileDialog" Width="20" Height="20" Margin="0,8,3,10" BorderThickness="0,0,0,0" >
							</Button>
						</DockPanel>
					</Border>
				</DockPanel>
			</Border>
			<!-- End of Left Panel -->
			<StackPanel Name="spRightPanel" Grid.Column="1" Grid.Row="0" Margin="0,20,20,5" HorizontalAlignment="Left" >

				<Expander Name="OutboxExpander" Visibility ="Visible" IsExpanded ="False" ExpandDirection ="Down">
					<Expander.Header>
						<Border  BorderBrush="{DynamicResource BorderBrush}" BorderThickness ="1"  CornerRadius ="0,10,0,0" Background="{DynamicResource OutboxHeaderBrush}" Width="350" >
							<DockPanel Name="dpOutBox" Width="350">
								<TextBlock DockPanel.Dock="Left" Width="Auto" Margin="5,2,2,2" Foreground="{DynamicResource HeaderTextBrush}">Outbox</TextBlock>
								<TextBlock DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="2,2,8,2" Foreground="{DynamicResource HeaderTextBrush}" >
									<TextBlock HorizontalAlignment="Right" Foreground="{DynamicResource HeaderTextBrush}" Text="{Binding ElementName=OutboxView, Path=Items.Count}"/>
									<Run Text =" Records"/>
								</TextBlock>
							</DockPanel>
						</Border>
					</Expander.Header>
					<ContentControl Width="350" HorizontalAlignment="Right" Margin="0,0,2,0" VerticalAlignment="Stretch">
						<ScrollViewer Background="{DynamicResource GridBodyBrush}" Height="90" Width="350" >
							<ListView Background ="{DynamicResource GridBrush}" x:Name="OutboxView" ItemsSource ="{Binding}"  ItemContainerStyleSelector="{StaticResource ListViewItemStyleSelector}">
								<ListView.View>
									<GridView>
										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle1}" Header="Posted On" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,2,0" Margin="0,0,0,0" >
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=PostedOn}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>

										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle2}" Header="Code" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border  BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,0,0" Margin="0,0,0,0">
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=Code}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>

										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle3}" Header="Title" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="2,0,0,0" Margin="0,0,0,0">
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=Title}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>
									</GridView>
								</ListView.View>
							</ListView>
						</ScrollViewer>
					</ContentControl>
				</Expander>
				<!-- Failed Grid -->
				<Expander Name="FailedExpander" Visibility ="Visible" IsExpanded ="False" ExpandDirection ="Down" >
					<Expander.Header>
						<Border  BorderBrush="{DynamicResource BorderBrush}" BorderThickness ="1"  CornerRadius ="0,10,0,0" Background="{DynamicResource OutboxHeaderBrush}" Width="350" >
							<DockPanel Name="dpInvalidRecords" Width="350">
								<TextBlock DockPanel.Dock="Left" HorizontalAlignment="Left" Margin="5,2,2,2" Foreground="{DynamicResource HeaderTextBrush}">Failed</TextBlock>
								<TextBlock DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="2,2,8,2" Foreground="{DynamicResource HeaderTextBrush}" >
									<TextBlock HorizontalAlignment="Right" Foreground="{DynamicResource HeaderTextBrush}" Text="{Binding ElementName=FailedView, Path=Items.Count}"/>
									<Run Text =" Records"/>
								</TextBlock>
							</DockPanel>
						</Border>
					</Expander.Header>
					<ContentControl HorizontalAlignment="Right" Margin="0,0,2,0" Width="350">
						<ScrollViewer Background="{DynamicResource GridBodyBrush}" Height="90" Width="350">
							<ListView Background ="{DynamicResource GridBrush}" Name="FailedView" ItemsSource ="{Binding}" ItemContainerStyleSelector="{StaticResource ListViewItemStyleSelector}">
								<ListView.View>
									<GridView>
										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle1}" Header="Posted On" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,2,0" Margin="0,0,0,0" >
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=PostedOn}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>

										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle2}" Header="Code" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border  BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,0,0" Margin="0,0,0,0">
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=Code}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>

										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle3}" Header="Title" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="2,0,0,0" Margin="0,0,0,0">
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=Title}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>
									</GridView>
								</ListView.View>
							</ListView>
						</ScrollViewer>
					</ContentControl>
				</Expander>
				<!-- Bulk Import Expander -->
				<Expander Name="BulkImportExpander" Visibility ="Visible" IsExpanded ="False" ExpandDirection ="Down" >
					<Expander.Header>
						<Border  BorderBrush="{DynamicResource BorderBrush}" BorderThickness ="1"  CornerRadius ="0,10,0,0" Background="{DynamicResource OutboxHeaderBrush}" Width="350" >
							<DockPanel Name="dpProfileView" Width="350">
								<TextBlock DockPanel.Dock ="Left" HorizontalAlignment="Left" Margin="5,2,2,2" Foreground="{DynamicResource HeaderTextBrush}">Bulk Imported Data</TextBlock>
								<!-- TBUC -->
								<Button Name="btnBulkSave" HorizontalAlignment="Right" Margin="10,0,50,0" DockPanel.Dock ="Left" Click="OnBulkSave_Click" Width ="50" Height ="Auto" Content="Save">
									<Button.Style>
										<Style>
											<Style.Triggers>
												<DataTrigger Binding ="{Binding ElementName=ProfileView, Path=Items.Count}" Value="0">
													<Setter Property="Button.IsEnabled" Value="false"/>
												</DataTrigger>
											</Style.Triggers>
										</Style>
									</Button.Style>
								</Button>
								<TextBlock DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="2,2,8,2" Foreground="{DynamicResource HeaderTextBrush}" >
									<TextBlock HorizontalAlignment="Right" Foreground="{DynamicResource HeaderTextBrush}" Text="{Binding ElementName=ProfileView, Path=Items.Count}"/>
									<Run Text =" Records"/>
								</TextBlock>
							</DockPanel>
						</Border>
					</Expander.Header>
					<ContentControl HorizontalAlignment="Right" Margin="0,0,2,0" Width="350">
						<ScrollViewer Background="{DynamicResource GridBodyBrush}" Height="90" Width="350">
							<ListView Background ="{DynamicResource GridBrush}" Name="ProfileView" ItemsSource ="{Binding}" ItemContainerStyleSelector="{StaticResource ListViewItemStyleSelector}">
								<ListView.View>
									<GridView>
										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle1}" Header="Posted On" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,2,0" Margin="0,0,0,0" >
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=PostedOn}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>

										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle2}" Header="Code" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border  BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,0,0" Margin="0,0,0,0">
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=Code}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>

										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle3}" Header="Title" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="2,0,0,0" Margin="0,0,0,0">
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=Title}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>
									</GridView>
								</ListView.View>
							</ListView>
						</ScrollViewer>
					</ContentControl>
				</Expander>
				<!-- Error Expander -->
				<Expander Name="ErrorExpander" Visibility ="Visible" IsExpanded ="False" ExpandDirection ="Down" DockPanel.Dock ="Top">
					<Expander.Header>
						<Border  BorderBrush="{DynamicResource BorderBrush}" BorderThickness ="1"  CornerRadius ="0,10,0,0" Background="{DynamicResource OutboxHeaderBrush}" Width="350" Height="Auto">
							<DockPanel Name="dpInvalidProfileView" Width="350">
								<TextBlock DockPanel.Dock="Left" HorizontalAlignment="Left" Foreground="{DynamicResource HeaderTextBrush}" Margin="5,2,2,2">Error Entries</TextBlock>
								<TextBlock DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="2,2,8,2" Foreground="{DynamicResource HeaderTextBrush}" >
									<TextBlock HorizontalAlignment="Right" Foreground="{DynamicResource HeaderTextBrush}" Text="{Binding ElementName=InvalidProfileView, Path=Items.Count}"/>
									<Run Text =" Records"/>
								</TextBlock>
							</DockPanel>
						</Border>
					</Expander.Header>
					<ContentControl HorizontalAlignment="Right" Width="350" Margin="0,0,2,0">
						<ScrollViewer Background="{DynamicResource GridBodyBrush}" Name="ScrollViewer1" Height="90" Width="350" >
							<ListView Background ="{DynamicResource GridBrush}" Name="InvalidProfileView" ItemsSource ="{Binding}" ItemContainerStyleSelector="{StaticResource ListViewItemStyleSelector}" >
								<ListView.View>
									<GridView>
										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle1}" Header="Posted On" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,2,0" Margin="0,0,0,0" >
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=PostedOn}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>

										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle2}" Header="Code" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border  BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,0,0" Margin="0,0,0,0">
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=Code}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>

										<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle3}" Header="Title" Width="110">
											<GridViewColumn.CellTemplate>
												<DataTemplate>
													<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="2,0,0,0" Margin="0,0,0,0">
														<TextBlock Margin="1,0,0,0" Text="{Binding Path=Title}"  Width="110"/>
													</Border>
												</DataTemplate>
											</GridViewColumn.CellTemplate>
										</GridViewColumn>
									</GridView>
								</ListView.View>
							</ListView>
						</ScrollViewer>
					</ContentControl>
				</Expander>
			</StackPanel>

			<StackPanel Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Margin="15,5,20,0" d:LayoutOverrides="Height" Grid.Row="1" >
				<Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness ="1" CornerRadius ="0,0,10,0" Margin="5,0,25,2" Background="{DynamicResource BottomPanelBrush}">
					<DockPanel Name="dpBottomPanel" FlowDirection="LeftToRight" Height="25">
						<Image Name="imgSchemaChanged" Visibility="Hidden"  Source="../../Images/Alert.png" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="15,5,5,5" Height="16" Width="23"></Image>
						<TextBlock Name="tbSchemaChanged" Visibility="Hidden"   Text="Schema Changed" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="5" Foreground="{DynamicResource HeaderTextBrush}"/>
						<TextBlock Name="tbSync" Visibility="Hidden"  Text="Synchronizing" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,5,15,5" Foreground="{DynamicResource HeaderTextBrush}"/>
						<Image Name="imgSync" Visibility="Hidden"   Source="../../Images/sync.png" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="5" Height="16" Width="23" HorizontalAlignment="Right">
							<Image.LayoutTransform>
								<RotateTransform CenterX="0.5" CenterY="0.5" />
							</Image.LayoutTransform>
						</Image>
					</DockPanel>
				</Border>
				<Border BorderBrush="{DynamicResource BorderBrush}" Name="BottomPanelShadow" CornerRadius ="0,10,0,0" Margin="5,0,25,5" Height="25" Background="{DynamicResource GridShadowBrush}"/>
			</StackPanel>
		</Grid>
	</Canvas>
</UserControl>

